* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/

* Open dataset

use 01_data/cis_data.dta, clear

* Generate interactions
gen cabine_use_cs = cabine_use * cs_dummy
gen cabine_use_vox = cabine_use * vox_dummy

* Run analyses
regr uncomfortable cabine_use cs_dummy cabine_use_cs if pp_dummy == 0, cluster(municipality)
est store uncomf_cs_nocontrols
estadd local Controls "No"

regr uncomfortable cabine_use cs_dummy cabine_use_cs female i.income age age_sq i.education i.TAMUNI i.CCAA if pp_dummy == 0, cluster(municipality)
est store uncomf_cs_controls
estadd local Controls "Yes"

regr uncomfortable cabine_use vox_dummy cabine_use_vox if pp_dummy == 0, cluster(municipality)
est store uncomf_vox_nocontrols
estadd local Controls "No"

regr uncomfortable cabine_use vox_dummy cabine_use_vox female i.income age age_sq i.education i.TAMUNI i.CCAA if pp_dummy == 0, cluster(municipality)
est store uncomf_vox_controls
estadd local Controls "Yes"

* Make table (without full list of controls)
esttab uncomf_cs_nocontrols uncomf_cs_controls uncomf_vox_nocontrols uncomf_vox_controls using 03_tables/tablef2.tex, tex se replace keep(cabine_use cs_dummy vox_dummy cabine_use_cs cabine_use_vox) coeflabels (cabine_use "Used booth to vote" cs_dummy "Ciudadanos voter" vox_dummy "Vox voter" cabine_use_cs "Used booth x Cs voter" cabine_use_vox "Used booth x Vox voter") nomtitles star(* 0.10 ** 0.05 *** 0.01) s(Controls, label("Controls")) addnotes("Standard errors are clustered by municipality" "The outcome variable is a dummy for whether each respondent showed" "signs of discomfort during the survey interview" "Models 2 and 4 include controls for income, education, age, age squared, size of" "respondent's municipality, and a dummy for respondents identifying as female" "The analyses exclude respondents who voted for PP") scalars(e(N))
